π‘οΈ Sentinel: Improve robustness and validate zstd level - #7
Conversation
- Add range validation (-7 to 22) for zstd compression level in CLI. - Pre-validate zstd level in main thread to prevent panics in workers. - Replace `unwrap()` in parallel worker threads with proper error handling when sending results, ensuring graceful shutdown if decoder is dropped. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Add range validation (-7 to 22) for zstd compression level in CLI. - Pre-validate zstd level in main thread to prevent panics in workers. - Replace `unwrap()` in parallel worker threads with proper error handling when sending results, ensuring graceful shutdown if decoder is dropped. - Run `cargo fmt` to comply with CI formatting requirements. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Add range validation (-7 to 22) for zstd compression level in CLI using clap value_parser. - Pre-validate zstd level in main thread to provide clean error messages and prevent panics in worker threads. - Replace `unwrap()` in parallel worker threads with proper error handling (Result propagation) when sending results, ensuring graceful shutdown if the decoder is dropped early. - Ensure all changes are properly formatted with `cargo fmt`. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
π‘οΈ Sentinel: Security and Robustness Enhancement
π¨ Severity: MEDIUM
π‘ Vulnerability: Potential denial-of-service via panics in background threads and lack of CLI input validation.
π― Impact: Malicious or accidental out-of-range input could crash the application. Dropping the decoder prematurely would cause worker threads to panic.
π§ Fix:
claprange validation forzstd_level..unwrap()with?in worker threads for graceful error propagation.β Verification: Ran
cargo testand verified that unit tests and regression tests pass. Verified CLI argument validation manually with a temporary script.PR created automatically by Jules for task 3176263320086829921 started by @kassoulet